package cn.edu.tsinghua.ie.ieFunds.service;

import cn.edu.tsinghua.ie.ieFunds.bean.system.Role;
import cn.edu.tsinghua.ie.ieFunds.repository.RoleRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class RoleService {

    @Autowired
    private RoleRepository roleRepository;

    public void addRole(Role role) {
        roleRepository.save(role);
    }

    public Role getRoleById(int roleId) {
        return roleRepository.getRoleByRoleId(roleId);
    }
}
